<?php
require ("header.php");
$TIPO = DB::select("tipos","*","WHERE id_nombre=?")->set(system::getNotEmpty($_GET["id"],'carne_roja'))->fetch(DB::FETCH_ASSOC);
if(empty($TIPO)){die("ups un error :)");}
$TIPOS = DB::select("tipos","id_nombre,nombre","WHERE id_nombre!=?")->set($TIPO["id_nombre"])->fetchAll(DB::FETCH_ASSOC);
?>
<link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css' />
<link href="css/fonts.css" rel="stylesheet" type="text/css" />
<link href="css/carneList.css" rel="stylesheet" type="text/css" />
	
		<meta charset="utf8"/>

	<div id="carneWrap">
		<div class="bgTit">
			<h2 class="tit"><?=$TIPO['nombre']?></h2><h6 class="detal"><?=$TIPO['resumen']?></h6>
		</div><!--end bgTit-->
		<div id="carneContent">
			<div class="types">
<?php foreach ($TIPOS as $t): ?>
	<a href="carnesA.php?id=<?=$t['id_nombre']?>" class="type"><?=$t['nombre']?></a>
<?php endforeach ?>

			</div>
			<div id="boxCarne">
<?php
$CARNES = DB::SELECT('carnes','*',"WHERE tipos=?")->set($TIPO["id_tipo"])->fetchAll(DB::FETCH_ASSOC);
foreach ($CARNES  as $row):extract($row,EXTR_REFS);
switch($animal_nombre){
	case 'vaca' : $url = 'vaca.php';break;
	case 'cerdo' : $url = 'cerdo.php';break;
	case 'oveja' : $url = 'oveja.php';break;
	case 'cabra' : $url = 'cabra.php';break;
	case 'jabali' : $url = 'jabali.php';break;
	case 'ciervo' : $url = 'ciervo.php';break;
	case 'avestruz' : $url = 'avestruz.php';break;
	case 'pollo' : $url = 'pollo.php';break;
	case 'pavo' : $url = 'pavo.php';break;
	case 'pato' : $url = 'pato.php';break;
	case 'conejo' : $url = 'c_menor.php';break;
	case 'perdiz' : $url = 'c_menor.php';break;
	case 'codorniz' : $url = 'c_menor.php';break;
	case 'faisan' : $url = 'c_menor.php';break;
	default:$url = 'carne.php?nombre=' . $animal_nombre;
}
?>
				<div id="boxCn">
					<div id="tabCn">
						<div id="Cn1"><h3 class="ostier"><?=$nombre?></h3></div>
						<div id="Cn2"><h4 class="tmb"><?=$tmb?></h4></div>
					</div>
					<br/>
					<div></div>
						<img src="<?=$img?>" class="img" /> <p class="descripcion"><?=$descrip?></p>
						<a href="<?=$url?>" class="inf">Detalles de los cortes de este animal</a>
				</div><!--end boxCn-->
<?php endforeach ?>
			</div><!--end boxCarne-->
		</div><!--end carneContent-->
	</div><!--end carneWrap-->
<?php 
	require ("footer.html");?>